//
//  EmplTimeCell.m
//  XDBaseFrameWork
//
//  Created by XD-XY on 10/25/14.
//  Copyright (c) 2014 XD-XY. All rights reserved.
//

#import "EmplTimeCell.h"

@implementation EmplTimeCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self makeViews];
    }
    return self;
}
// 加载cell中的内容
-(void)makeViews
{
    
    // 日期
    self.dayLB = [UILabel initLabelText:@"今天" andRect:CGRectMake(0,0,UI_SCREEN_WIDTH/5.0f,36) andBackGroudColor:[UIColor whiteColor] andTextFont:[UIFont systemFontOfSize:17] andTextColor:UIColorFromRGB(0x676767) andTextAlignment:NSTextAlignmentCenter];
    [self.contentView addSubview:_dayLB];

    // 上午按钮
    self.amBtn = [UIButton initButton:CGRectMake(0,height_y(_dayLB),UI_SCREEN_WIDTH/5.0f-0.5,43.5) btnNorImage:LOADIMAGE(@"etime_nor@2x") btnDisableBtn:LOADIMAGE(@"etime_sel@2x") btnTitle:@"上午未定" titleNorColor:UIColorFromRGB(0x616161) titleSelectColor:UIColorFromRGB(0xf1f1f1) titleFont:[UIFont systemFontOfSize:13]];

    _amBtn.tag = 1001;
    [self.contentView addSubview:_amBtn];
    
    // 下午按钮
    self.pmBtn = [UIButton initButton:CGRectMake(0,height_y(_amBtn),UI_SCREEN_WIDTH/5.0f-0.5,43.5) btnNorImage:LOADIMAGE(@"etime_nor@2x") btnDisableBtn:LOADIMAGE(@"etime_sel@2x") btnTitle:@"下午未定" titleNorColor:[UIColor blackColor] titleSelectColor:[UIColor greenColor] titleFont:[UIFont systemFontOfSize:16]];
    self.pmBtn.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_pmBtn];
    _amBtn.tag = 1002;


    // 监听点击事件
    [_amBtn addTarget:self action:@selector(chooseTime:) forControlEvents:UIControlEventTouchUpInside];
    [_pmBtn addTarget:self action:@selector(chooseTime:) forControlEvents:UIControlEventTouchUpInside];
}

-(void)chooseTime:(UIButton *)sender
{
    [_delegate chooseTheEmplTimeWith:nil andAmOrPm:@"hh"];
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
